package com.jic.order.api;

import com.jic.common.base.vo.RestResult;
import com.jic.order.rest.request.*;
import com.jic.order.rest.response.ShoppingCartAddResponse;
import com.jic.order.rest.response.ShoppingCartInfoListQueryResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: gaolanyu
 * @date: 2020-01-23
 * @remark:
 */
@FeignClient(name = "jic-order", path = "/shopping-cart")
public interface ShoppingCartFeign {
    @PostMapping(value = "query-shopping-cart")
    public RestResult<ShoppingCartInfoListQueryResponse> queryShoppingCart(@RequestBody ShoppingCartInfoListQueryRequest shoppingCartInfoListQueryRequest);

    @PostMapping(value = "add-shopping-cart")
    public RestResult<ShoppingCartAddResponse> add(@RequestBody ShoppingCartAddRequest shoppingCartAddRequest);

    @PostMapping(value = "delete-shopping-cart")
    public RestResult<Boolean> delete(@RequestBody ShoppingCartDeleteRequest shoppingCartDeleteRequest);

    @PostMapping(value = "editNum-shopping-cart")
    public RestResult<Boolean> editNum(@RequestBody ShoppingCartEditRequest shoppingCartEditRequest);

    /**
     * 选择购物车商品
     * @param shoppingCartSelectedRequest
     * @return
     */
    @PostMapping(value = "select-settle-shopping-cart")
    public RestResult<Boolean> selected(@RequestBody ShoppingCartSelectedRequest shoppingCartSelectedRequest);

    @PostMapping(value = "cancel-settle-shopping-cart")
    public RestResult<Boolean> unSelected(@RequestBody ShoppingCartSelectedRequest shoppingCartSelectedRequest);

    @PostMapping(value = "query-goods-num")
    public RestResult<Integer> queryShoppingCartNum(@RequestBody UserRequest userRequest);
}
